package com.itheima02.service;

import com.itheima.Student;
import com.itheima02.mapper.StudentMapperImpl;

import java.util.List;

public class StudentServiceImpl implements StudentService {
    StudentMapperImpl mapper = new StudentMapperImpl();

    @Override
    public List<Student> selectAll() {
        List<Student> list = mapper.selectAll();
        return list;
    }

    @Override
    public Student selectById(Integer id) {
        Student stu = mapper.selectById(id);
        return stu;
    }

    @Override
    public int insert(Student stu) {
        int res = mapper.insert(stu);
        return res;
    }

    @Override
    public int delete(Integer id) {
        int res = mapper.delete(id);
        return res;
    }

    @Override
    public int update(Student stu) {
        int res = mapper.update(stu);
        return res;
    }
}
